# from langchain_openai import OpenAIEmbeddings
# embeddings = OpenAIEmbeddings(model = 'text-embedding-3-large')

from langchain_community.embeddings import HuggingFaceEmbeddings
model_name = 'BAAI/bge-small-en'
model_kars = {"device":"cpu"}
encode_kwargs = {"normalize_embeddings":True}
hf = HuggingFaceEmbeddings(
    model_name = model_name,model_kwargs=model_kars,encode_kwargs=encode_kwargs
)
words = ['cat','dog','computer','animal']
doc_vectors = hf.embed_documents(words)
from scipy.spatial.distance import pdist,squareform
import numpy as np
x = np.array(doc_vectors)
dists = squareform(pdist(x))
import pandas as pd
df = pd.DataFrame(
    data = dists,
    index=words,
    columns=words
)
print(df.head())